/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.ap.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.ap.entity.Subject;
import com.jeeplus.modules.ap.mapper.SubjectMapper;

/**
 * 科目Service
 * @author 李超辉
 * @version 2017-12-22
 */
@Service
@Transactional(readOnly = true)
public class SubjectService extends TreeService<SubjectMapper, Subject> {

	public Subject get(String id) {
		return super.get(id);
	}
	
	public List<Subject> findList(Subject subject) {
		if (StringUtils.isNotBlank(subject.getParentIds())){
			subject.setParentIds(","+subject.getParentIds()+",");
		}
		return super.findList(subject);
	}
	
	@Transactional(readOnly = false)
	public void save(Subject subject) {
		super.save(subject);
	}
	
	@Transactional(readOnly = false)
	public void delete(Subject subject) {
		super.delete(subject);
	}
	
}